<%-- 
    Document   : add_karyawan
    Created on : Jul 29, 2012, 4:41:05 PM
    Author     : MiChi
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<jsp:include page="check_session.jsp" />
<!DOCTYPE html>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Add Karyawan</title>

        <link href="style/style.css" rel="stylesheet" type="text/css" />


        <script src="javascript/validasi_data.js"></script>
        <script type="text/javascript">
            function cekData(form) {
                pesan = "PERINGATAN";
                hasil = true;
                
                if(!cekText(form.txtnama)){
                    pesan += "\nNama karyawan Kosong";
                    hasil = false;
                }
                if(!cekText(form.txtnoidentitas)){
                    pesan += "\nNo identitas karyawan Kosong";
                    hasil = false;
                }
                if(!cekText(form.txtalamat)){
                    pesan += "\nalamat karyawan Kosong";
                    hasil = false;
                }
                if(!cekTelepon(form.txtnotelp)){
                    pesan += "\nNotelepon harus angka";
                    hasil = false;
                }

               
            
                if(!hasil) {
                    alert(pesan);
                }
            
                return hasil;
            }
            
            function resetData(form){
                resetField(form.txtNama);
                
            }
        </script>
    </head>

    <body>
        <div id="central">

            <div id="menuatas">
                <marquee>
                    <h3> Welcome </h3>
                </marquee>
            </div>

            <div id="header">
                <%
                    boolean isLogged = false;
                    if (request.getSession().getAttribute("user") != null) {
                        out.write("<a href='Logout'>LogOut</a>");
                        isLogged = true;
                    } else {
                        out.write("<a href='login.jsp'>LogIn</a>");
                    }
                %> 
            </div>

            <ul id="navlist">
                <li><a id="n1" href="index.jsp"><span>Home</span></a></li>
                <li><a id="n2" href="view_karyawan.jsp"><span>Karyawan</span></a></li>
                <li><a id="n3" href="view_pekerjaan.jsp"><span>Pekerjaan</span></a></li>
                <li><a id="n4" href="view_alokasi.jsp"><span>Alokasi Pekerjaan</span></a></li>                               
                <li><a id="n5" href="about.jsp"><span>About</span></a></li>                               
            </ul>

            <div id="content" />                
            <div id="rightside">
                <h1>Tambah Data Karyawan</h1>
                <hr><br>
                <form method="post" action="TambahKaryawan" onsubmit="return cekData(this)">
                    <table>

                        <tr>
                            <td> Nama</td>
                            <td>:</td>
                            <td><input type="text" name="txtnama" ></td>
                        </tr>
                        <tr>
                            <td> No.Identitas</td>
                            <td>:</td>
                            <td><input type="text" name="txtnoidentitas" ></td>
                        </tr>
                        <tr>
                            <td>alamat</td>
                            <td>:</td>
                            <td><input type="text" name="txtalamat" ></td>
                        </tr>
                        <tr>
                            <td>notelp</td>
                            <td>:</td>
                            <td><input type="text" name="txtnotelp" ></td>
                        </tr>

                        <tr>
                            <td colspan="3" align="center">
                                <input type="submit" value="Tambah" size="15" />
                                &nbsp;
                                <input type="button" value="Reset" size="15" onclick="resetData(this)" />
                            </td>
                        </tr>
                    </table>
                </form>
            </div>

            <div id="footer">
                <p>&COPY; copyright TR PERSISTENCE</p>
            </div>
        </div>
    </body>
</html>

